<admintpl file="header"/>
<body class="J_scroll_fixed">
<div class="wrap J_check_wrap">
  <ul class="nav nav-tabs">
     <li><a href="{:U('Order/index')}">订单列表</a></li>
     <li class="active"><a href="{:U('Order/statistics')}">订单统计</a></li>
     <li><a href="{:U('Order/logistics')}">物流导入</a></li>
  </ul>
<style> 
input .duoxuan{ width:14px; height:14px;} 
span .duoxuan{ margin-right:15px;} 
</style>
		<form class="well form-search" method="post" action="{:U('Order/statistics')}">
			<div class="search_type cc mb10">
				<div class="mb10">
					<span class="mr20">订单状态： 
		        		<foreach name="configs" item="vo">
		        			<if condition="$vo['typeID'] gt 150 && $vo['typeID'] lt 190">	               	
	               	<input type="checkbox" name="typeID[]" value='{$vo.typeID}'style="margin-top: -2px;"/>
	               	<span class="duoxuan">{$vo.typeName}</span>
		        			</if>
		            </foreach>
						时间：
						<input type="text" name="start_time" value="{$formpost.start_time}" class="J_date" style="width: 80px;">-
						<input type="text" name="end_time" value="{$formpost.end_time}" class="J_date" style="width: 80px;"> &nbsp; &nbsp;
						<input type="submit" class="btn btn-primary" value="统计" />
						<if condition="$num neq 0">
							共有 {$num} 条相关记录
						</if>
					</span>
				</div>
			</div>
		</form>
    <!-- 为ECharts准备一个具备大小（宽高）的Dom -->
    <div id="main" style="height:450px;width: 800px;"></div>
    <!-- ECharts单文件引入 -->
    <script src="__ROOT__/statics/js/echarts.js"></script>
    <script type="text/javascript">
        // 路径配置
        require.config({
            paths: {
                echarts: 'http://echarts.baidu.com/build/dist'
            }
        });
        
        // 使用
        require(
            [
                'echarts',
                'echarts/chart/bar'
            ],
            function (ec) {
                // 基于准备好的dom，初始化echarts图表
                var myChart = ec.init(document.getElementById('main')); 
option = {
    title : {
    	<if condition="!$formpost['end_time']">
        text: '{$formpost.start_time}至今订单状态统计',
      <else />
        text: '{$formpost.start_time}至{$formpost.end_time}订单状态统计',
    	</if>
        x:'center'
    },
    tooltip : {
        trigger: 'axis'
    },
    xAxis : [
        {
            type : 'category',
            data : [<foreach name="type" item="vo">'{$vo.typeName}',</foreach>]
        }
    ],
    yAxis : [
        {
            type : 'value'
        }
    ],
    series : [
        {
            name:'共',
            type:'bar',
            data:[<foreach name="count" item="vo">{$vo},</foreach>]
        }
    ]
};
                    
                // 为echarts对象加载数据 
                myChart.setOption(option); 
            }
        );
    </script>
    
			<foreach name="values" item="vo">
				订单状态：<b>{$vo.type}</b>，共<b>{$vo.unit}</b>单记录，总计支付金额 <b>{$vo.amount}</b><br>
			</foreach>
</div>

<script type="text/javascript" src="__ROOT__/statics/js/common.js"></script>
</body>
</html>